<?php get_header(); $options = get_cubic_option(); ?>

<div id="left_col">

 <div id="archive_headline">
  <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

  <?php if (is_category()) { ?>
  <h2><?php printf(__('Archive for the &#8216;<span id="keyword"> %s </span>&#8217; Category', 'cubic'), single_cat_title('', false)); ?></h2>

  <?php } elseif( is_tag() ) { ?>
  <h2><?php printf(__('Posts Tagged &#8216;<span id="keyword"> %s </span>&#8217;', 'cubic'), single_tag_title('', false) ); ?></h2>

  <?php } elseif (is_day()) { ?>
  <h2><?php printf(__('Archive for &#8216;<span id="keyword"> %s </span>&#8217;', 'cubic'), get_the_time(__('F jS, Y', 'cubic'))); ?></h2>

  <?php } elseif (is_month()) { ?>
  <h2><?php printf(__('Archive for &#8216;<span id="keyword"> %s </span>&#8217;', 'cubic'), get_the_time(__('F, Y', 'cubic'))); ?></h2>

  <?php } elseif (is_year()) { ?>
  <h2><?php printf(__('Archive for &#8216;<span id="keyword"> %s </span>&#8217;', 'cubic'), get_the_time(__('Y', 'cubic'))); ?></h2>

  <?php } elseif (is_author()) { ?>
  <?php global $wp_query; $curauth = $wp_query->get_queried_object(); //get the author info ?>
  <h2><?php printf(__('Archive for the &#8216;<span id="keyword"> %s </span>&#8217;', 'cubic'), $curauth->display_name ); ?></h2>

  <?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
  <h2><?php _e('Blog Archives', 'cubic'); ?></h2>

  <?php }; ?>

 </div><!-- END #archive_headline -->


 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <div class="post">
  <h3 class="title<?php if(!$options['show_date']){ echo ' no_date'; }; ?>"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
  <?php if ($options['show_date']) : ?>
  <ul class="meta1 cf">
   <li class="post_date"><?php the_time(__('m/d. Y', 'cubic')) ?></li>
   <?php edit_post_link(__('EDIT', 'cubic'), '<li class="post_edit">', '</li>' ); ?>
  </ul>
  <?php endif; ?>
  <div class="post_content cf">
   <?php the_content(__('Read more', 'cubic')); ?>
   <?php wp_link_pages(); ?>
  </div>
  <?php if ($options['show_category'] or $options['show_tag'] or $options['show_author'] or $options['show_comment']) { ?>
  <ul class="meta2 cf">
   <?php if ($options['show_category']) : ?>
   <?php if(has_category()) { ?>
   <li class="post_category"><?php the_category(' , '); ?></li>
   <?php }; ?>
   <?php endif; ?>
   <?php if ($options['show_tag']) : ?>
   <?php the_tags('<li class="post_tags">',' , ','</li>'); ?>
   <?php endif; ?>
   <?php if ($options['show_author']) : ?>
   <li class="post_author"><?php the_author_posts_link(); ?></li>
   <?php endif; ?>
   <?php if ($options['show_comment']) : ?>
   <li class="post_comment"><?php comments_popup_link(__('Write comment', 'cubic'), __('1 comment', 'cubic'), __('% comments', 'cubic')); ?></li>
   <?php endif; ?>
  </ul>
  <?php }; ?>
 </div><!-- END .post -->

 <?php endwhile; else: ?>

 <div class="post">
  <h3 class="title"><?php _e("Sorry, but you are looking for something that isn't here.","cubic"); ?></h3>
 </div>

 <?php endif; ?>

 <?php if ($options['pager'] == 'pager') { ?>
 <?php include('navigation.php'); ?>
 <?php } else { ?>
 <div id="prev_next_post" class="cf">
  <p class="next_post"><?php next_posts_link( __( 'Older posts', 'cubic' ) ); ?></p>
  <p class="prev_post"><?php previous_posts_link( __( 'Newer posts', 'cubic' ) ); ?></p>
 </div>
 <?php }; ?>

</div><!-- END #left_col -->

<?php if($options['layout'] == 'right') { ?>
<div id="right_col">
 <?php get_sidebar(); ?>
</div>
<?php }; ?>

<?php get_footer(); ?>